package com.allen.imsystem.message.mappers;

import com.allen.imsystem.common.bean.PageBean;
import com.allen.imsystem.message.model.vo.MsgRecord;
import com.allen.imsystem.message.model.pojo.PrivateMsgRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * 私聊信息的数据库表操作类
 */
@Mapper
@Repository
public interface PrivateMsgRecordMapper extends BaseMapper<PrivateMsgRecord> {

    /**
     * 查询私聊会话的聊天记录
     * @param chatId 会话id
     * @param beginMsgId 从哪一条消息id开始查找
     * @param uid 用户id
     * @param pageBean 分页实体类
     * @return 聊天记录列表
     */
    List<MsgRecord> findMsgRecordList(@Param("chatId") Long chatId, @Param("beginMsgId") Long beginMsgId,
                                      @Param("uid") String uid, @Param("pageBean") PageBean pageBean);

}